package com.itboye.ihomebank.adapter;

import java.util.List;

import android.content.Context;
import android.view.View;
import android.view.View.OnClickListener;
import android.widget.Toast;

import com.itboye.ihomebank.R;
import com.itboye.ihomebank.support.commonadapter.MutiplyCommonAdapter;
import com.itboye.ihomebank.support.commonadapter.ViewHolder;
/***
 * 示例adapter
 * @author mr.w
 *
 */
public class NewAdapter extends MutiplyCommonAdapter<Object>{

	int position;
	public NewAdapter(Context context, List<Object> datas, int... layoutId) {
		super(context, datas, layoutId);
		// TODO Auto-generated constructor stub
	}

	@Override
	public int getItemViewType(int position) {
		// TODO Auto-generated method stub
		
		return 0;
	}

	@Override
	public void convert(ViewHolder holder, Object t, int type,final int position) {
		// TODO Auto-generated method stub
		holder.setText(R.id.item_img, t+"");

		holder.setText(R.id.text2, t+"");
		holder.setTag(R.id.item_img, this.position);
		holder.setOnClickListener(R.id.item_img,position, new OnClickListener() {
			
			@Override
			public void onClick(View v) {
				// TODO Auto-generated method stub
				Toast.makeText(mContext, position+"", 0).show();
			}
		});
	}

	@Override
	public void getItemPosition(int position) {
		// TODO Auto-generated method stub
		this.position=position;
	}

	

}
